package org.deyang.tools.amazon.utils;

public class ASINUtils {
	public static boolean isValidISBN(String asin){
		int check = 0;
	    String t = asin.substring(9);
	    try {
			for (int i = 0; i < 9; i++) {
			    check += Integer.valueOf(asin.substring(i, i + 1)) * (10 - i);
			}
			check += (t.equals("x") || t.equals("X")) ? 10 : Integer.valueOf(t);
			return check % 11 == 0 ;
		} catch (NumberFormatException e) {
			return false;
		}
	}

}
